package com.swotplus.quartz.task;

import com.swotplus.system.sys.entity.SysPost;
import com.swotplus.system.sys.service.SysPostService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.time.LocalDateTime;
import java.util.List;

@Component
public class TaskTest {


    @Autowired
    private SysPostService sysPostService;
    /**
     * 检查状态1
     */
    @Scheduled(cron = "*/5 * * * * ?")
    public void checkState1() {

     System.out.println(LocalDateTime.now());
       List<SysPost> list=sysPostService.list();
        System.out.println(list.size());
    }
}
